<?php
/**
 * Created by PhpStorm.
 * User: 方文达
 * Date: 2015/6/27
 * Time: 18:02
 */

use GuzzleHttp\Client;

require "./vendor/autoload.php";

$name = convgb(addslashes($_GET['name']));
$name2 = convgb(addslashes($_GET['name2']));
$age = intval($_GET['age']);
$sex = convgb(addslashes($_GET['sex']));
$type = addslashes($_GET['type']);
$job = convgb(addslashes($_GET['job']));

$client = new Client(['base_uri'=>'http://localhost:8765']);

$response = $client->get('?name='.$name.'&sex='.$sex.'&name2='.$name2.'&type='.$type.'&job='.$job.'&age='.$age);

//echo '?name='.$name.'&sex='.$sex.'&name2='.$name2.'&type'.$type.'&job='.$job;
$couplets = $response->getBody();

echo $couplets;

function convgb($string)
{
    return mb_convert_encoding($string,'gb2312','utf-8' );
}


